#!/usr/bin/python3
# -*- coding: utf8 -*-
# Date   : 2021/07/21
# Author : Kwan
# Email  : allenxian@live.com
# Blog   : https://my.oschina.net/u/4173440

from flask import Blueprint, render_template, redirect, url_for, request, json, session
from flask_login import login_required,current_user
from project.define import app_logger, manager_required
from .page import Messager


# 数据恢复
recovery = Blueprint(name='recovery', import_name='project', url_prefix='/recovery', template_folder='routes/recovery/html')
PageMessager = Messager()
RouterName = "recovery"


@recovery.route('/')
@login_required
@manager_required
def default():
    """
    重定向
    """
    return redirect(url_for('recovery.parking'))


@recovery.route('/parking')
@login_required
@manager_required
def parking():
    """
    恢复在场记录
    """
    return render_template('recovery_parking.html', **PageMessager.parking_page_data())


@recovery.route('/charge')
@login_required
@manager_required
def charge():
    """
    恢复收费记录
    """
    return render_template('recovery_charge.html', **PageMessager.charge_page_data())


@recovery.route('/past')
@login_required
@manager_required
def past():
    """
    恢复通过记录
    """
    return render_template('recovery_parking.html', **PageMessager.parking_page_data())